/**
 * components/Row.js
 * Define your component using platform-independent primitives
 */
import React from "react";

import { View, StyleSheet } from "react-native";
import PropTypes from "prop-types";

import { Color, ScreenWidth } from "../../common/index";

const DivideLine = props => {
  const {
    width, height, marginBottom, marginTop, backgroundColor, color, marginLeft, marginRight,
  } = props;
  return (
    <View
      style={{
        width,
        height,
        marginBottom,
        marginTop,
        backgroundColor,
      }}
    >
      <View
        style={{
          flex: 1,
          backgroundColor: color,
          marginLeft,
          marginRight,
        }}
      />
    </View>
  );
};

DivideLine.propsTypes = {
  height: PropTypes.number,
  width: PropTypes.number,
  marginLeft: PropTypes.number,
  marginTop: PropTypes.number,
  marginBottom: PropTypes.number,
  marginRight: PropTypes.number,
  backgroundColor: PropTypes.string,
  color: PropTypes.string,
};

DivideLine.defaultProps = {
  backgroundColor: Color.white,
  width: ScreenWidth,
  color: Color.line_divideline,
  height: StyleSheet.hairlineWidth,
  marginLeft: 0,
  marginRight: 0,
  marginTop: 0,
  marginBottom: 0,
};
export default DivideLine;
